﻿namespace Community.CsharpSqlite.Entity
{
    /*
** A structure for holding a single date and time.
*/
    //typedef struct DateTime DateTime;
    public class Sqlite3DateTime
    {
        public int D; /* Year, month, and day */
        public int M; /* Year, month, and day */
        public int Y; /* Year, month, and day */
        public int h; /* Hour and minutes */
        public long iJD; /* The julian day number times 86400000 */
        public int m; /* Hour and minutes */
        public double s; /* Seconds */
        public int tz; /* Timezone offset in minutes */
        public byte validHMS; /* True (1) if h,m,s are valid */
        public byte validJD; /* True (1) if iJD is valid */
        public byte validTZ; /* True (1) if tz is valid */
        public byte validYMD; /* True (1) if Y,M,D are valid */

        public void CopyTo(Sqlite3DateTime ct)
        {
            ct.iJD = iJD;
            ct.Y = Y;
            ct.M = M;
            ct.D = D;
            ct.h = h;
            ct.m = m;
            ct.tz = tz;
            ct.s = s;
            ct.validYMD = validYMD;
            ct.validHMS = validHMS;
            ct.validJD = validJD;
            ct.validTZ = validJD;
        }
    };
}